home *** CD-ROM | disk | FTP | other *** search
- function cat_position()
- {
- mc = eval("mcCelLayer.mc_" + caty + "_" + catx);
- mcCat._x = mc._x;
- mcCat._y = mc._y;
- mcCat._visible = true;
- }
- function all_disable()
- {
- var i;
- var j;
- i = 0;
- while(i < ymax)
- {
- j = 0;
- while(j < xmax)
- {
- if(cel[i][j].stat == 1)
- {
- var mc = eval("mcCelLayer.mc_" + i + "_" + j);
- mc.gotoAndStop(2);
- }
- j++;
- }
- i++;
- }
- }
- function all_enable()
- {
- var i;
- var j;
- i = 0;
- while(i < ymax)
- {
- j = 0;
- while(j < xmax)
- {
- var mc = eval("mcCelLayer.mc_" + i + "_" + j);
- if(cel[i][j].stat == 1)
- {
- if(j == catx && i == caty)
- {
- mc.gotoAndStop(2);
- }
- else
- {
- mc.gotoAndStop(3);
- }
- mc._visible = true;
- }
- if(cel[i][j].stat == 2)
- {
- mc.gotoAndStop(4);
- mc._visible = true;
- }
- j++;
- }
- i++;
- }
- }
- addx0 = [1,0,-1,-1,-1,0];
- addy0 = [0,1,1,0,-1,-1];
- addx1 = [1,1,0,-1,0,1];
- addy1 = [0,1,1,0,-1,-1];
- xmax = 15;
- ymax = 15;
- cel = new Array();
- i = 0;
- while(i < ymax)
- {
- cel[i] = new Array();
- j = 0;
- while(j < xmax)
- {
- cel[i][j] = new Object();
- cel[i][j].stat = 0;
- cel[i][j].win = 0;
- j++;
- }
- i++;
- }
- catx = Math.floor(xmax / 2);
- caty = Math.floor(ymax / 2);
- cel[caty][catx].stat = 1;
- lx = new Array();
- ly = new Array();
- ld = new Array();
- lx[0] = catx;
- ly[0] = caty;
- lmax = 1;
- lx2 = new Array();
- ly2 = new Array();
- i = 2;
- while(i < ymax - 2)
- {
- j = 2;
- while(j < xmax - 2)
- {
- cel[i][j].stat = 1;
- j++;
- }
- i++;
- }
- loop = 0;
- while(loop < 20)
- {
- rx = Math.floor(Math.random() * xmax);
- ry = Math.floor(Math.random() * ymax);
- if(rx != catx && ry != caty)
- {
- if(cel[ry][rx].stat == 1)
- {
- cel[ry][rx].stat = 2;
- }
- }
- loop++;
- }
- i = 0;
- while(i < ymax)
- {
- j = 0;
- while(j < xmax)
- {
- if(cel[i][j].stat == 1)
- {
- k = 0;
- while(k < 6)
- {
- var nx = !(i % 2) ? j + addx0[k] : j + addx1[k];
- var ny = i + addy0[k];
- if(cel[ny][nx].stat == 0)
- {
- cel[i][j].win = 1;
- }
- k++;
- }
- }
- j++;
- }
- i++;
- }
- w = 34;
- h = 26;
- opx = (- (xmax - 1)) * w / 2;
- opy = (- (ymax - 1)) * h / 2;
- c = 0;
- i = 0;
- while(i < ymax)
- {
- j = 0;
- while(j < xmax)
- {
- mcName = "mc_" + i + "_" + j;
- mcCelLayer.attachMovie("mcCelOrg",mcName,c);
- mc = eval("mcCelLayer." + mcName);
- mc._x = opx + j * w;
- if(i % 2)
- {
- mc._x += w / 4;
- }
- else
- {
- mc._x -= w / 4;
- }
- mc._y = opy + i * h;
- mc._visible = false;
- c++;
- j++;
- }
- i++;
- }
-